
import { App } from "vue"
import { CompInst, VueComponent } from "xcore/cmpnt"

const render = {
    installed: false,
    compList: {} as Record<string, VueComponent>,
    install: function (app: App) {
        if (this.installed) return
        this.installed = true
        // 定义组件加载器类
        const vueCmpnt = import.meta.glob<{ default: VueComponent }>("./cmpnts/*.vue", { eager: true })
        var cmpntInst = new CompInst(vueCmpnt)
        this.compList = cmpntInst.cmpnts
        cmpntInst.install(app)
    }
}
export default render